﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public enum Nmae
    {
        刘大爷 = 1,
        曹老板,
        孙十万
    }
    public enum act
    {
        剪刀 = 1,
        石头,
        布
    }
    class Program
    {
        public static object Computer { get; private set; }

        static void Main(string[] args)
        {
            Console.WriteLine("******************");
            Console.WriteLine("*****游戏开始*****");
            Console.WriteLine("游戏规则：1剪刀.2石头3.布");
            Console.WriteLine("选择对手：1 刘大爷  2  曹老板 3 孙十万");

            int computer = int.Parse(Console.ReadLine());
            name name = name.刘大爷;
            name = (Name)computer;

            Console.WriteLine("输入您的名字");
            string player = Console.ReadLine();
            player P = new player(player);

            Console.WriteLine(player + "" + "VS" + "" + name);

            int time = 0;

            int[] play = { 0 };
            int[] Computer = { 0 };

            perpare(name, P, time, Play, Computer);
        }
        private static void perpare(Nmae name, player P, int time, int[] Play, int[] Computer)
        {
            Console.WriteLine("开始游戏 ？ Y/N");
            string key = Console.ReadLine();

            switch (key)
            {
                case "Y":
                    gamebegin(name, P, time, Play, Computer);
                    break;

                case "N":
                    Console.WriteLine("在见了，您内");
                    break;
                default:
                    break;
            }
        }

        private static void gamebegin(Nmae name, player p, int time, int[] play, int[] computer)
        {
            Console.WriteLine("还来吗 ? Y/N");
            string T = Console.ReadLine();
            switch (T)
            {
                case "Y":
                    gamebegin(name, P, time, Play, Computer);
                    break;

                case "N":
                    result(name, P, time, Play, Computer);

                    gameAgain(name, P, time, Play, Computer);
                    break;

                default:
                    break;
            }
        }
        private static void result(Name name, player P, int time, int[] Play, int[] Computer)
        {
            Console.WriteLine("***********************");
            Character character = new Character((name)nmae);

            Console.WriteLine(P.player + "" + "VS" + "" + name);

            Console.WriteLine("对战次数" + time);

            judgment j = new judgment();
 

            Console.WriteLine("姓名/t得分");


            Console.WriteLine(P.Player + "   " + Play[0]);
            Console.WriteLine(name + "   " + Computer[0]);

            if (Play[0]> Computer[0])
            {
                Console.WriteLine(P.Player+"胜利 我要把你的头盖骨当碗使"+"|"+P.Player+"打得不错，你可以走了");
            }
            if (Play[0] == Computer[0])
            {
                Console.WriteLine("你赢了，但没有完全赢");



                private static void gamebegin(Name name, player P, int time, int[] Play, int[] Computer)
                {


                    Console.WriteLine("请出拳：1.剪刀 2.石头 3.布(输入相应数字)");

              

                    int p = int.Parse(Console.ReadLine());


                 
                    Character character = new Character((name)name);

                    judge(P.fingerGuess(p), character.fingerGuess(character), Play, Computer);
                    
                    time++;


                    gameover(name, P, time, Play, Computer);

                }
              
                public static void judge(int player, int computer, int[] Play, int[] Computer)
                {


                    if (player == 1 & computer == 2)
                    {
                        Console.WriteLine("打得不错，你可以走了");
                        Computer[0]++;

                    }
                    else if (player == 1 & computer == 3)
                    {
                        Console.WriteLine("胜利 我要把你的头盖骨当碗使");
                        Play[0]++;

                    }
                    else if (player == 1 & computer == 1)
                    {
                        Console.WriteLine("你赢了，但没有完全赢");
                    }
                    //石头
                    else if (player == 2 & computer == 3)
                    {
                        Console.WriteLine("打得不错，你可以走了");
                        Computer[0]++;
                    }
                    else if (player == 2 & computer == 1)
                    {
                        Console.WriteLine("胜利 我要把你的头盖骨当碗使");
                        Play[0]++;
                    }
                    else if (player == 2 & computer == 2)
                    {
                        Console.WriteLine("你输了，但没有完全输");
                    }
                    //布
                    else if (player == 3 & computer == 1)
                    {
                        Console.WriteLine("打得不错，你可以走了");
                        Computer[0]++;
                    }
                    else if (player == 3 & computer == 2)
                    {
                        Console.WriteLine("胜利 我要把你的头盖骨当碗使"); 
                         Play[0]++;
                    }
                    else if (player == 3 & computer == 3)
                    {
                        Console.WriteLine("你们平局了，是真平局了");
                    }

                }
            }


        }